//
//  MSHomeController.m
//  觅尚
//
//  Created by No.8 on 2019/3/19.
//  Copyright © 2019 No.8. All rights reserved.
//

#import "MSHomeController.h"
#import "MSCheckDetailedController.h"
#import "MSRoomDetailedController.h"
#import "MSHomeCell.h"
#import "QLCycleProgressView.h"
#import "MSBookersOpeningRankController.h"
#import "MSRoomManagementController.h"
#import "MSSweepCodeActivityController.h"
#import "MSBusinessStatementController.h"
#import "MSHomeListModel.h"
#import "MSHomeRoomTypeModel.h"
#import "MSRoomProgressView.h"
#import "MSChaoConsumptionController.h"
#import "MSCaiwuController.h"
#import "AppDelegate.h"


@interface MSHomeController ()<UITableViewDataSource,UITableViewDelegate>
/** 表视图*/
@property(nonatomic,strong)UITableView *tableView;

/** 考勤信息*/
@property(nonatomic,strong)UIImageView *CheckIMG;


/** 表头*/
@property(nonatomic,strong)UIView * HeaderView;


@property (nonatomic, strong) QLCycleProgressView *progressView;

@property (nonatomic, strong) MSRoomProgressView *RoomProgressView;
/** 考勤信息*/
@property(nonatomic,strong)NSString *CheckStr;

/** 按钮*/
@property(nonatomic,strong)NSString *CheckButtonStr;


/** 房间标题*/
@property(nonatomic,strong)NSString *RoomStr;

/** 房间按钮*/
@property(nonatomic,strong)NSString *RoomButtonStr;

/** 营业报表按钮*/
@property(nonatomic,strong)NSString *BusinessButtonStr;

/** 营业报表标题*/
@property(nonatomic,strong)NSString *BusinessStr;




/********属性*********/
/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString * shouyiTitleLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString * shouyiLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString * CashLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *WxchatLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *PayCardLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *AlipayLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *VIPTitleLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *RechargeLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *ConsumptionLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *guazhangTitleLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *RepaymentLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *RepaymentamountLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *qitaTitleLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *qitaLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *OCashLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *OWxchatLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *zhaodaiTitleLabel;

/** shouyiTitleLabel*/
@property(nonatomic,strong)NSString *ZTotalLabel;


/** 今日出勤人数*/
@property(nonatomic,strong)NSString *attendanceToday;

/** 员工总数*/
@property(nonatomic,strong)NSString *totalNumber;

/** 商户总人数*/
@property(nonatomic,strong)NSString *staffCount;

/** 商户已打卡人数*/
@property(nonatomic,strong)NSString *punchCount;



/** 数组*/
@property(nonatomic,strong)NSMutableArray *listArray;


/** 数组*/
@property(nonatomic,strong)NSMutableArray *roomTypeListArray;

/** 超房间消费*/
@property(nonatomic,strong)NSString *overConsumption;

/** 超消费房间总数*/
@property(nonatomic,strong)NSString *consumptionlist;


/** 房间管理*/
@property(nonatomic,strong)NSString *roomTime;

/** 营业报表*/
@property(nonatomic,strong)NSString *yingyeTime;


/** 营业报表*/
@property(nonatomic,strong)NSString *TongJiyingyeTime;

/** 扫码活动*/
@property(nonatomic,strong)NSString *sweepCode;

/** 扫码活动按钮*/
@property(nonatomic,strong)NSString *statisticalDetails;



/** 营业报表*/
@property(nonatomic,strong)NSString *incomebankCardMoney;


/** 营业报表*/
@property(nonatomic,strong)NSString *incomeotherAilMoney;

/** 扫码活动*/
@property(nonatomic,strong)NSString *incomeotherMemberShipMoney;


/** 今日收入*/
@property(nonatomic,strong)NSString *sumMoneyTitle;

/** 今日收入*/
@property(nonatomic,strong)NSString *sumMoney;
/** 更多*/
@property(nonatomic,strong)NSString *more;
/** 扫码次数*/
@property(nonatomic,strong)NSString *sweepCodeSize;

/** 今日获奖人次*/
@property(nonatomic,strong)NSString *winningPeople;
/** 扫码次数count*/
@property(nonatomic,strong)NSString *rewardNumber;

/** 订房人开房排名*/
@property(nonatomic,strong)NSString *reservationRanking;

/** */
@property(nonatomic,strong)NSString *roomsNumber;

/** */
@property(nonatomic,strong)NSString *openRooms;

/** */
@property(nonatomic,strong)NSString *makeCount;

/** */
@property(nonatomic,strong)NSString *sunCount;

/** 更多*/
@property(nonatomic,strong)NSString *roommore;

/** <#name#>*/
@property(nonatomic,strong)NSString *updateStatus;



@property(nonatomic,strong)NSString *updateDescription;

/** 遮盖层*/
@property(nonatomic,strong)UIView *backView;


/** 弹出View*/
@property(nonatomic,strong)UIView *showView;


/** 遮盖层*/
@property(nonatomic,strong)UIView *backView1;


/** 弹出View*/
@property(nonatomic,strong)UIView *showView1;


/** <#name#>*/
@property(nonatomic,strong)NSString *versionStatus;

@end

@implementation MSHomeController
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:YES];
    self.navigationController.navigationBar.hidden = YES;
    self.listArray = [NSMutableArray new];
    self.roomTypeListArray = [NSMutableArray new];
    Prepare *header = [Prepare headerWithRefreshingTarget:self refreshingAction:@selector(MJChiBaoZiHeaderRefresh)];
    // 隐藏时间
    header.lastUpdatedTimeLabel.hidden = YES;
    header.stateLabel.hidden = YES;
    // 马上进入刷新状态
    self.tableView.mj_header = header;
    [self.tableView.mj_header beginRefreshing];
}
- (void)MJChiBaoZiHeaderRefresh{
    
    [self ReloadData];
}
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:YES];
    self.navigationController.navigationBar.hidden = YES;
    
}
- (QLCycleProgressView *)progressView {
    if (!_progressView) {
        _progressView = [[QLCycleProgressView alloc]initWithFrame:CGRectMake(ScreenWidth / 2 - 175 * px, 200 * px, 300 * px, 300 * px)];
//                _progressView.backgroundColor = [UIColor redColor];
        
    }
    return _progressView;
}

/** 表视图*/
- (void)CreattableView{
//    self.extendedLayoutIncludesOpaqueBars = YES;
//    if (!_tableView) {
    
        if (@available(iOS 11.0, *)) {
            
            UIScrollView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
            
        } else {
            
            self.automaticallyAdjustsScrollViewInsets = NO;
            
        }
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight - self.tabBarController.tabBar.height) style:UITableViewStyleGrouped];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.backgroundColor = [UIColor clearColor];
        _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        [self.view addSubview:self.tableView];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.backgroundColor = WYCRGBColor(20, 33, 48);
    
    
    [self AddLoginView];
     
     [self AnimationClick];
    
    [self shareAppVersionAlert];
}
- (void)shareAppVersionAlert {
    NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
    
    NSString *appVersion = [NSString stringWithFormat:@"v%@",infoDict[@"CFBundleShortVersionString"]];
    //
    NSDictionary * params = @{@"clientCategory":@3,@"currentVersionNumber":appVersion};
    
    WYCLog(@"--------%@",params);
    
    [HTTPRequest POST:MScheckUpdate params:params succeed:^(id responseObject) {
        WYCLog(@"--------%@",responseObject);
        if (CodeStr) {
            NSDictionary * dict = responseObject[@"data"];
            if ([dict[@"newVersion"] isEqual:@"-1"]) {
                
            }else{
                NSString * updateStatus = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"newVersion"][@"updateStatus"]];
                self.updateStatus = updateStatus;
                self.versionStatus = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"currentVersion"][@"versionStatus"]];

                
                self.updateDescription = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"newVersion"][@"updateDescription"]];
                [self GupdateStatus];
            }
        }else{
            
            
        }
        
    } failure:^(NSError *error) {
        WYCLog(@"--------%@",error);
        [MBManager showBriefAlert:Failed];
    }];
    
    
    
}











- (void)GupdateStatus{
    if ([self.versionStatus intValue] != 1) {
    if ([self.updateStatus isEqualToString:@"1"]) {
        UIView * view = [[UIView alloc] init];
        view.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
        view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
        [[UIApplication sharedApplication].keyWindow  addSubview:view];
        self.backView1 = view;
        
        
        UIView * showView = [[UIView alloc] init];
        showView.frame = CGRectMake(200 * px, ScreenHeight / 2 , ScreenWidth - 400 * px, ScreenHeight / 5);
        showView.backgroundColor = [UIColor whiteColor];
        showView.layer.cornerRadius = 20 * px;
        [view addSubview:showView];
        self.showView1 = showView;
        
        
        UIButton * choseButton = [[UIButton alloc] init];
        choseButton.frame = CGRectMake(showView.width - 90 * px, 20 * px, 60 * px, 60 * px);
        [choseButton setImage:[UIImage imageNamed:@"pop_dis"] forState:UIControlStateNormal];
        [choseButton addTarget:self action:@selector(choseButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [showView addSubview:choseButton];
        
        /** title*/
        UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 50 * px, showView.width, 60 * px)];
        titleLabel.textColor = [UIColor blackColor];
        titleLabel.text = @"更新最新版本";
        titleLabel.textAlignment = NSTextAlignmentCenter;
        titleLabel.font = [UIFont systemFontOfSize:SYRealValue(35 / 2)];
        [showView addSubview:titleLabel];
        
        
        /** title*/
        UILabel * Label = [[UILabel alloc] initWithFrame:CGRectMake(10 * px, CGRectGetMaxY(titleLabel.frame) + 20 * px, showView.width, 60 * px)];
        Label.textColor = [UIColor blackColor];
        Label.text = [NSString stringWithFormat:@"%@",self.updateDescription];
        Label.textAlignment = NSTextAlignmentLeft;
        Label.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
        [showView addSubview:Label];
        
        UIView * lineView = [[UIView alloc] initWithFrame:CGRectMake(0, showView.height / 3 * 2, showView.width, 1)];
        lineView.backgroundColor = WYCRGBColor(106, 186, 246);
        [showView addSubview:lineView];
        /** 确定*/
        UIButton * quuedingButton = [[UIButton alloc] initWithFrame:CGRectMake(100 * px, CGRectGetMaxY(lineView.frame) + 40 * px, showView.width / 2 - 200 * px, 60 * px)];
        [quuedingButton setTitle:@"确定" forState:UIControlStateNormal];
        quuedingButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
        [quuedingButton  setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
        [quuedingButton  addTarget:self action:@selector(quuedingButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [showView addSubview:quuedingButton];
        
        
        /** 确定*/
        UIButton * quxiaoButton = [[UIButton alloc] initWithFrame:CGRectMake(100 * px + showView.width / 2, quuedingButton.y, quuedingButton.width,quuedingButton.height)];
        [quxiaoButton setTitle:@"取消" forState:UIControlStateNormal];
        quxiaoButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
        [quxiaoButton  setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [quxiaoButton  addTarget:self action:@selector(quxiaoButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [showView addSubview:quxiaoButton];
    }else if ([self.updateStatus isEqualToString:@"2"]){
        UIView * view = [[UIView alloc] init];
        view.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
        view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
        [[UIApplication sharedApplication].keyWindow  addSubview:view];
        self.backView = view;
        
        
        UIView * showView = [[UIView alloc] init];
        showView.frame = CGRectMake(200 * px, ScreenHeight / 2 , ScreenWidth - 400 * px, ScreenHeight / 5);
        showView.backgroundColor = [UIColor whiteColor];
        showView.layer.cornerRadius = 20 * px;
        [view addSubview:showView];
        self.showView = showView;
        
        
        
        
        /** title*/
        UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 50 * px, showView.width, 60 * px)];
        titleLabel.textColor = [UIColor blackColor];
        titleLabel.text = @"更新最新版本";
        titleLabel.textAlignment = NSTextAlignmentCenter;
        titleLabel.font = [UIFont systemFontOfSize:SYRealValue(35 / 2)];
        [showView addSubview:titleLabel];
        
        
        /** title*/
        UILabel * Label = [[UILabel alloc] initWithFrame:CGRectMake(10 * px, CGRectGetMaxY(titleLabel.frame) + 20 * px, showView.width, 60 * px)];
        Label.textColor = [UIColor blackColor];
        Label.text = [NSString stringWithFormat:@"%@",self.updateDescription];
        Label.textAlignment = NSTextAlignmentLeft;
        Label.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
        [showView addSubview:Label];
        
        UIView * lineView = [[UIView alloc] initWithFrame:CGRectMake(0, showView.height / 3 * 2, showView.width, 1)];
        lineView.backgroundColor = WYCRGBColor(106, 186, 246);
        [showView addSubview:lineView];
        /** 确定*/
        UIButton * quuedingButton = [[UIButton alloc] initWithFrame:CGRectMake(100 * px, CGRectGetMaxY(lineView.frame) + 40 * px, showView.width / 2 - 200 * px, 60 * px)];
        [quuedingButton setTitle:@"确定" forState:UIControlStateNormal];
        quuedingButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
        [quuedingButton  setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
        [quuedingButton  addTarget:self action:@selector(quuedingButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [showView addSubview:quuedingButton];
        
        
        /** 确定*/
        UIButton * quxiaoButton = [[UIButton alloc] initWithFrame:CGRectMake(100 * px + showView.width / 2, quuedingButton.y, quuedingButton.width,quuedingButton.height)];
        [quxiaoButton setTitle:@"取消" forState:UIControlStateNormal];
        quxiaoButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
        [quxiaoButton  setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [quxiaoButton  addTarget:self action:@selector(QianzhiquxiaoButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [showView addSubview:quxiaoButton];
        
        
        
    }else{
        
        
    }
        
    }else{
        
    }
}

- (void)quxiaoButtonClick{
    
    [self choseButtonClick];
}
- (void)quuedingButtonClick{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://itunes.apple.com/app/id1458685882"]];
    
}
- (void)QianzhiquxiaoButtonClick{
    AppDelegate *app = [UIApplication sharedApplication].delegate;
    UIWindow *window = app.window;
    [UIView animateWithDuration:1.0f animations:^{
        window.alpha = 0;
        window.frame = CGRectMake(0, window.bounds.size.width, 0, 0);
    } completion:^(BOOL finished) {
        exit(0);
    }];
}
- (void)choseButtonClick{
    
    [self.backView1 removeFromSuperview];
}
/** 添加界面*/
- (void)AddLoginView{
    [self CreattableView];
    
    [self CreatHeaderView];
    
    [self CheckIMG];
    
    [self progressView];
    
    
}

- (void)ReloadData{
    [self.listArray removeAllObjects];
    [self.roomTypeListArray removeAllObjects];
    NSDictionary * params = @{@"busid":[WYCAccountTool unarchivebelongBusid],@"uid":[WYCAccountTool unarchiveuid]};
    WYCLog(@"-------%@",params);
    [HTTPRequest POST:MSgetInformation params:params succeed:^(id responseObject) {
        WYCLog(@"-------%@",responseObject);
        if (CodeStr) {
            [self.tableView.mj_header endRefreshing];
            
            
            //房间
            self.roomTime = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"updateTime"]];
            self.sunCount = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"sunCount"]];
            self.overConsumption = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"overConsumption"]];
            self.RoomStr = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"roomManagement"]];
            self.RoomButtonStr = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"roomDetails"]];
            self.listArray = [MSHomeListModel mj_objectArrayWithKeyValuesArray:responseObject[@"data"][@"room"][@"list"]];
            self.roomTypeListArray = [MSHomeRoomTypeModel mj_objectArrayWithKeyValuesArray:responseObject[@"data"][@"room"][@"roomTypeList"]];
            self.consumptionlist = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"consumptionlist"]];
            
            self.reservationRanking = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"reservationRanking"]];
            self.roomsNumber = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"roomsNumber"]];
            self.openRooms = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"openRooms"]];
            self.makeCount = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"makeCount"]];
            self.roommore = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"more"]];
//            self.sunCount = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"room"][@"sunCount"]];
            //扫码
            self.statisticalDetails = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"reward"][@"statisticalDetails"]];
            self.sweepCode = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"reward"][@"sweepCode"]];
            /** 今日收入*/
            self.sumMoneyTitle = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"reward"][@"sumMoneyTitle"]];
            
            /** 今日收入*/
            self.sumMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"reward"][@"sumMoney"]];
            /** 更多*/
            self.more = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"reward"][@"more"]];
            /** 扫码次数*/
            self.sweepCodeSize = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"reward"][@"sweepCodeSize"]];
            
            /** 今日获奖人次*/
            self.winningPeople = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"reward"][@"winningPeople"]];
            /** 扫码次数count*/
            self.rewardNumber = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"reward"][@"rewardNumber"]];
            
            
            //考情
            self.CheckStr = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"attendance"][@"attendanceInformation"]];
            self.CheckButtonStr = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"attendance"][@"attendanceStatistics"]];
//            WYCLog(@"-------%@",self.CheckLabel.text);
            self.attendanceToday = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"attendance"][@"attendanceToday"]];
            
            self.totalNumber = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"attendance"][@"totalNumber"]];
            
            self.staffCount = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"attendance"][@"staffCount"]];
            
            self.punchCount = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"attendance"][@"punchCount"]];
            

            
            
            //营业报表
            self.BusinessStr = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"businessStatement"]];
            self.BusinessButtonStr = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"statisticalDetails"]];
            self.yingyeTime = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"updateTime"]];
            self.TongJiyingyeTime = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"statisticalTime"]];
            /********收益总额********/
            //收益总额
            self.shouyiTitleLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"totalTitle"]];
            
            //收益总额
            self.shouyiLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"totalIncome"]];
        
            //现金
            self.CashLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"cashMoney"]];
            
            //微信
            self.WxchatLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"weChatMoney"]];
            
            //刷卡
            self.PayCardLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"bankCardMoney"]];
            
            //支付宝
            self.AlipayLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"aliMoney"]];
            
            /******** 会员卡********/
            //会员卡
            self.VIPTitleLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"membershipCard"]];
            
            //充值入账
            self.RechargeLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"memberCardMoney"]];
            
            
            //消费入账
            self.ConsumptionLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"membershipMoney"]];
            
            /******** 挂账数据 ********/
            //挂账数据
            self.guazhangTitleLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"accountingData"]];
            
            
            //今日挂账还款
            self.RepaymentLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"repaymentMoney"]];
            
            
            //今日挂账额
            self.RepaymentamountLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"accountingMoney"]];
            
            
            
            /******** 其他收益 ********/
            //其它收益额
            self.qitaTitleLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"otherTitle"]];
            
            
            //今日挂账还款
            self.qitaLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"otherSumMoney"]];
            
            
            //现金
            self.OCashLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"otherCashMoney"]];
            
            //微信
            self.OWxchatLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"otherWeChatMoney"]];
            
            /******** 招待费用 ********/
            //招待费用
            self.zhaodaiTitleLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"rewardTitle"]];
            
            //今日挂账还款
            self.ZTotalLabel = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"rewardMoney"]];
            
            
            self.incomebankCardMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"bankCardMoney"]];
            
            
            self.incomeotherAilMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"otherAilMoney"]];
            
            self.incomeotherMemberShipMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"income"][@"otherMemberShipMoney"]];
            
            
        }else{
            [self.tableView.mj_header endRefreshing];
            [MBManager showBriefAlert:responseObject[@"msg"]];
        }
        [self.tableView reloadData];
    } failure:^(NSError *error) {
        [self.tableView.mj_header endRefreshing];
        
    }];
}



- (void)CreatHeaderView{
    
    UIView * HeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 600 * px)];
    [self.view addSubview:HeaderView];
    
    
    UIImageView * HeaderIMG = [[UIImageView alloc] initWithFrame:CGRectMake(HeaderView.x, 0, HeaderView.width, HeaderView.height - 100 * px)];
    HeaderIMG.image = [UIImage imageNamed:@"头图"];
    [HeaderView addSubview:HeaderIMG];
    
    NSString * businessName = [[NSUserDefaults standardUserDefaults] objectForKey:@"businessName"];
    
    /** 商户*/
    UIButton * businessButton = [[UIButton alloc] initWithFrame:CGRectMake(ScreenWidth / 2 - 200 * px, 100 * px, 400 * px, 80 * px)];
    [businessButton setTitle:businessName forState:UIControlStateNormal];
    businessButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(36 / 2)];
    [businessButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    businessButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    [HeaderView addSubview:businessButton];
    
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"YYYY年MM月dd日"];
    NSDate *datenow = [NSDate date];
    NSString *currentTimeString = [formatter stringFromDate:datenow];
    //日期
    UILabel *DateLabel = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, CGRectGetMaxY(HeaderIMG.frame), ScreenWidth / 3, 80 * px)];
    DateLabel.text = [NSString stringWithFormat:@"%@",currentTimeString];
    DateLabel.textColor = WYCRGBColor(139, 149, 171);
    DateLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [HeaderView addSubview:DateLabel];
    
    
    _tableView.tableHeaderView = HeaderView;
    
}
- (void)AnimationClick{
    
    
}

#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 4;
}

//返回每组头部view

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"HH:mm"];
    NSDate *datenow = [NSDate date];
    NSString *currentTimeString = [formatter stringFromDate:datenow];
    
    UIView *headerView = [[UIView alloc]init];
//    headerView.backgroundColor = [UIColor redColor];
//    headerView.frame = CGRectMake(0, 0, ScreenWidth, 130 * px);
    
    headerView.backgroundColor = WYCRGBColor(20, 33, 48);
    
    
    //图片
    UIImageView *CheckIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 30 * px, 40 * px, 40 * px)];
    [headerView addSubview:CheckIMG];
    
    if (section == 0) {
        
        CheckIMG.image = [UIImage imageNamed:@"kqxx_icon"];
        
        
        //标题
        UILabel * CheckLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(CheckIMG.frame) + 20 * px, 20 * px, 230 * px, 60 * px)];
        CheckLabel.textColor = [UIColor whiteColor];
        CheckLabel.text = [NSString stringWithFormat:@"%@",_CheckStr];
        CheckLabel.font = [UIFont boldSystemFontOfSize:SYRealValue(34 / 2)];
        [headerView addSubview:CheckLabel];
//        self.CheckLabel = CheckLabel;
//        WYCLog(@"-------%@",CheckLabel.text);
        //详情按钮
        UIButton * CheckButton = [[UIButton alloc] initWithFrame:CGRectMake( ScreenWidth - 270 * px, CheckLabel.y - 5 * px, CheckLabel.width, CheckLabel.height + 10 * px)];
        //设置边框的颜色
        [CheckButton.layer setBorderColor:WYCRGBColor(80, 112, 148).CGColor];
        CheckButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
        //设置边框的粗细
        [CheckButton setTitle:[NSString stringWithFormat:@"%@",self.CheckButtonStr] forState:UIControlStateNormal];
        [CheckButton.layer setBorderWidth:1.0];
        [CheckButton setTitleColor:WYCRGBColor(59, 84, 112) forState:UIControlStateNormal];
        CheckButton.layer.cornerRadius = 35 * px;
        [CheckButton addTarget:self action:@selector(CheckButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [headerView addSubview:CheckButton];
//        [detailedButton setTitle:@"考勤统计" forState:UIControlStateNormal];
        
        //时间
        
        
        
//        Timelabel.text = @"更新时间：03.15";
        
    }else if (section == 1) {
        
        
        //标题
        UILabel * RoomLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(CheckIMG.frame) + 20 * px, 20 * px, 230 * px, 60 * px)];
        RoomLabel.textColor = [UIColor whiteColor];
        RoomLabel.text = [NSString stringWithFormat:@"%@",self.RoomStr];
        RoomLabel.font = [UIFont boldSystemFontOfSize:SYRealValue(34 / 2)];
        [headerView addSubview:RoomLabel];
//        self.RoomLabel = RoomLabel;
        
        
        CheckIMG.image = [UIImage imageNamed:@"fjgl_icon"];
        //详情按钮
        UIButton * RoomButton = [[UIButton alloc] initWithFrame:CGRectMake(ScreenWidth - 270 * px, RoomLabel.y - 5 * px, RoomLabel.width, 70 * px)];
        //设置边框的颜色
        [RoomButton.layer setBorderColor:WYCRGBColor(80, 112, 148).CGColor];
        RoomButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
        [RoomButton setTitle:[NSString stringWithFormat:@"%@",self.RoomButtonStr] forState:UIControlStateNormal];
        //设置边框的粗细
        [RoomButton addTarget:self action:@selector(RoomButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [RoomButton.layer setBorderWidth:1.0];
        [RoomButton setTitleColor:WYCRGBColor(59, 84, 112) forState:UIControlStateNormal];
        RoomButton.layer.cornerRadius = 35 * px;
        [headerView addSubview:RoomButton];
       
        //时间
        UIImageView *TimeIMG = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(RoomLabel.frame), RoomLabel.y + 20 * px, 40 * px, 40 * px)];
        TimeIMG.image = [UIImage imageNamed:@"gxxj_icon"];
        [headerView addSubview:TimeIMG];
        
        
        UILabel * Timelabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(TimeIMG.frame) + 10 * px, TimeIMG.y, 350 * px,TimeIMG.height)];
        Timelabel.textColor = WYCRGBColor(139, 149, 171);
        Timelabel.text = [NSString stringWithFormat:@"%@",self.roomTime];
        Timelabel.font = [UIFont boldSystemFontOfSize:SYRealValue(24 / 2)];
        [headerView addSubview:Timelabel];
        
        
    }else if (section == 2) {
        //标题
        UILabel * BusinessLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(CheckIMG.frame) + 20 * px, 20 * px, 230 * px, 60 * px)];
        BusinessLabel.textColor = [UIColor whiteColor];
        BusinessLabel.text = [NSString stringWithFormat:@"%@",self.BusinessStr];
        BusinessLabel.font = [UIFont boldSystemFontOfSize:SYRealValue(34 / 2)];
        [headerView addSubview:BusinessLabel];
        
        //详情按钮
        UIButton * BusinessButton = [[UIButton alloc] initWithFrame:CGRectMake(ScreenWidth - 270 * px, BusinessLabel.y - 5 * px, BusinessLabel.width, BusinessLabel.height + 10 * px)];
        //设置边框的颜色
        [BusinessButton setTitle:[NSString stringWithFormat:@"%@",self.BusinessButtonStr] forState:UIControlStateNormal];
        [BusinessButton.layer setBorderColor:WYCRGBColor(80, 112, 148).CGColor];
        BusinessButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
        //设置边框的粗细
        [BusinessButton addTarget:self action:@selector(BusinessButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [BusinessButton.layer setBorderWidth:1.0];
        [BusinessButton setTitleColor:WYCRGBColor(59, 84, 112) forState:UIControlStateNormal];
        BusinessButton.layer.cornerRadius = 35 * px;
        [headerView addSubview:BusinessButton];
        
        //时间
       
        
        CheckIMG.image = [UIImage imageNamed:@"yybb_icon"];
//        [detailedButton setTitle:@"统计详情" forState:UIControlStateNormal];
//        Titlelabel.text = @"营业报表";
//        [detailedButton addTarget:self action:@selector(BusinessButtonClick) forControlEvents:UIControlEventTouchUpInside];
        UIImageView *TimeIMG = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(BusinessLabel.frame), BusinessLabel.y + 20 * px, 40 * px, 40 * px)];
        
        TimeIMG.image = [UIImage imageNamed:@"gxxj_icon"];
        [headerView addSubview:TimeIMG];
        
        UILabel * Timelabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(TimeIMG.frame) + 10 * px, TimeIMG.y, 350 * px,TimeIMG.height)];
        Timelabel.textColor = WYCRGBColor(139, 149, 171);
        Timelabel.text = [NSString stringWithFormat:@"%@",self.yingyeTime];
        Timelabel.font = [UIFont boldSystemFontOfSize:SYRealValue(24 / 2)];
        [headerView addSubview:Timelabel];
        
        UILabel * TongJiTimelabel = [[UILabel alloc] initWithFrame:CGRectMake(CheckIMG.x, CGRectGetMaxY(Timelabel.frame) + 20 * px, ScreenWidth ,TimeIMG.height)];
        TongJiTimelabel.textColor = WYCRGBColor(139, 149, 171);
        TongJiTimelabel.text = [NSString stringWithFormat:@"%@",self.TongJiyingyeTime];
        TongJiTimelabel.font = [UIFont boldSystemFontOfSize:SYRealValue(24 / 2)];
        [headerView addSubview:TongJiTimelabel];
        
        
    }else {
        CheckIMG.image = [UIImage imageNamed:@"smhd_icon"];
        //标题
        UILabel * ScandLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(CheckIMG.frame) + 20 * px, 20 * px, 230 * px, 60 * px)];
        ScandLabel.textColor = [UIColor whiteColor];
        ScandLabel.text = [NSString stringWithFormat:@"%@",self.sweepCode];
        ScandLabel.font = [UIFont boldSystemFontOfSize:SYRealValue(34 / 2)];
        [headerView addSubview:ScandLabel];
        
        //详情按钮
        UIButton * ScandButton = [[UIButton alloc] initWithFrame:CGRectMake( ScreenWidth - 270 * px, ScandLabel.y - 5 * px, ScandLabel.width, ScandLabel.height + 10 * px)];
        //设置边框的颜色
        [ScandButton setTitle:[NSString stringWithFormat:@"%@",self.statisticalDetails] forState:UIControlStateNormal];
        [ScandButton.layer setBorderColor:WYCRGBColor(80, 112, 148).CGColor];
        ScandButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
        //设置边框的粗细
        [ScandButton addTarget:self action:@selector(SweepButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [ScandButton.layer setBorderWidth:1.0];
        [ScandButton setTitleColor:WYCRGBColor(59, 84, 112) forState:UIControlStateNormal];
        ScandButton.layer.cornerRadius = 35 * px;
        [headerView addSubview:ScandButton];
//        [detailedButton setTitle:@"统计详情" forState:UIControlStateNormal];
//        [detailedButton addTarget:self action:@selector(SweepButtonClick) forControlEvents:UIControlEventTouchUpInside];
//        Titlelabel.text = @"扫码活动";
        
    }
    
    return headerView;
    
}


//考勤
- (void)CheckButtonClick{
    
    MSCheckDetailedController * CheckVC = [[MSCheckDetailedController alloc] init];
    [self.navigationController pushViewController:CheckVC animated:NO];
}
//营业报表
- (void)BusinessButtonClick{
    
    MSBusinessStatementController * BusinessVC = [[MSBusinessStatementController alloc] init];
    [self.navigationController pushViewController:BusinessVC animated:NO];
}
//扫码
- (void)SweepButtonClick{
    
    MSSweepCodeActivityController * SweepCodeVC = [[MSSweepCodeActivityController alloc] init];
    [self.navigationController pushViewController:SweepCodeVC animated:NO];
}

//房间管理
- (void)RoomButtonClick{
    
    MSRoomDetailedController * RoomVC = [[MSRoomDetailedController alloc] init];
    [self.navigationController pushViewController:RoomVC animated:NO];
}


// 返回组头部view的高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    if (section == 2) {
        return 180 * px;
    }else{
        return 130 * px;
    }
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (section == 2) {
        return 5;
    }else{
        return 1;
    }
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section == 0) {
        return 500 * px;
    }else if (indexPath.section == 1){
        return 950 * px;
    }else if (indexPath.section == 3){
        return 700 * px;
    }else{
        if (indexPath.row == 0){
            return 400 * px;
        }else if (indexPath.row == 3){
            return 450 * px;
        }else{
            
            return 300 * px;
        }
    }
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    
    MSHomeCell * cell = [MSHomeCell cellWithTableView:tableView];
    tableView.backgroundColor = [UIColor clearColor];
    //无色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
//    [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
    if (indexPath.section == 0){
        
        cell.contentView.backgroundColor = WYCRGBColor(20, 33, 48);
        
        UIView *CellView = [[UIView alloc]init];
        CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 500 * px);
        CellView.backgroundColor = BackViewColor;
        CellView.layer.cornerRadius = 20 * px;
        CellView.layer.masksToBounds = YES;
        [cell.contentView addSubview:CellView];
        _progressView.progress = [self.punchCount intValue] / [self.staffCount intValue];
        WYCLog(@"progress-------%f",_progressView.progress);
        _progressView.titleJump.text = [NSString stringWithFormat:@"%@",self.attendanceToday];
        _progressView.totletJump.text = [NSString stringWithFormat:@"%@:%@",self.totalNumber,self.staffCount];
        
        _progressView.countJump.text = [NSString stringWithFormat:@"%@",self.punchCount];
        [CellView addSubview:_progressView];
    }else if (indexPath.section == 1){
        
        cell.contentView.backgroundColor = WYCRGBColor(20, 33, 48);
        
        UIView *CellView = [[UIView alloc]init];
        CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 950 * px);
        CellView.cornerRadius = 20 * px;
        CellView.backgroundColor = BackViewColor;
        [cell.contentView addSubview:CellView];
        
         _RoomProgressView = [[MSRoomProgressView alloc]initWithFrame:CGRectMake(_progressView.x, 150 * px, _progressView.width, 300 * px)];
        
        double Summer = [self.makeCount intValue] / [self.sunCount intValue];
//        _RoomProgressView.progress
        WYCLog(@"_RoomProgressView.progress-------%f",Summer);
        WYCLog(@"_RoomProgressView.progress-------%f",_RoomProgressView.progress);
        WYCLog(@"makeCount-------%d",[self.makeCount intValue]);
        WYCLog(@"sunCount-------%d",[self.sunCount intValue]);
        _RoomProgressView.titleJump.text = [NSString stringWithFormat:@"%@",self.openRooms];
        _RoomProgressView.totletJump.text = [NSString stringWithFormat:@"%@:%@",self.roomsNumber,self.sunCount];
        
        _RoomProgressView.countJump.text = [NSString stringWithFormat:@"%@",self.makeCount];
        [CellView addSubview:_RoomProgressView];
        
        
        /** <#name#>*/
        UIButton * amitionButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, CellView.width, 300 * px)];
//        amitionButton.backgroundColor = [UIColor redColor];
        [amitionButton addTarget:self action:@selector(amitionButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [CellView  addSubview:amitionButton];
        
//        [CellView addSubview:_progressView];
        UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height * 0.4, CellView.width, 1)];
        line.backgroundColor = WYCRGBColor(55, 63, 84);
        [CellView addSubview:line];
        
        
        UIView * verticalline = [[UIView alloc] initWithFrame:CGRectMake(CellView.width * 0.5, CGRectGetMaxY(line.frame), line.height,CellView.height - line.height)];
        verticalline.backgroundColor = WYCRGBColor(55, 63, 84);
        [CellView addSubview:verticalline];
        
        
        UILabel * ReservationrankingLabel = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, CGRectGetMaxY(line.frame) + 60 * px, 400 * px, 60 * px)];
        ReservationrankingLabel.text = [NSString stringWithFormat:@"%@",self.reservationRanking];
        ReservationrankingLabel.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
        ReservationrankingLabel.textColor = [UIColor whiteColor];
        [CellView addSubview:ReservationrankingLabel];
        
        UIView *rankingView = [[UIView alloc]init];
        rankingView.frame = CGRectMake(ReservationrankingLabel.x, CGRectGetMaxY(ReservationrankingLabel.frame) + 30 * px, ScreenWidth * 0.4, 300  * px);
        rankingView.backgroundColor = [UIColor clearColor];
        [CellView addSubview:rankingView];
        
        /** <#name#>*/
        UIButton * rankingButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, rankingView.width, rankingView.height)];
        [rankingButton  addTarget:self action:@selector(CellMoreButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [rankingView  addSubview:rankingButton];
        
        
//        NSArray * arrNumber = @[@"1",@"2",@"3"];
        
        for (NSInteger i = 0; i < self.listArray.count; i ++) {
            MSHomeListModel * model = self.listArray[i];
            
            UILabel * NumberLabel = [[UILabel alloc] init];
            NumberLabel.x = 0;
            NumberLabel.height = 60 * px;
            NumberLabel.y = (NumberLabel.height + 15) * i;
            NumberLabel.width = NumberLabel.height;
            NumberLabel.text = [NSString stringWithFormat:@"%@.",model.index];
            NumberLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            NumberLabel.textColor = WYCRGBColor(141,153,178);
            [rankingView addSubview:NumberLabel];
            
            UIImageView * photoIMG = [[UIImageView alloc] init];
            photoIMG.x = CGRectGetMaxX(NumberLabel.frame) + 10 * px;
            [photoIMG sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",model.avatarUrl]] placeholderImage:[UIImage imageNamed:@"我的占位图片"]];
            photoIMG.height = NumberLabel.height;
            photoIMG.y = (photoIMG.height + 15) * i;
            photoIMG.backgroundColor = WYCRGBColor(141,153,178);
            photoIMG.cornerRadius = 30 * px;
            photoIMG.width = photoIMG.height;
            [rankingView addSubview:photoIMG];
            
            
            UILabel * NameLabel = [[UILabel alloc] init];
            NameLabel.x = CGRectGetMaxX(photoIMG.frame) + 10 * px;;
            NameLabel.height = NumberLabel.height;
            NameLabel.y = (NameLabel.height + 15) * i;
            NameLabel.width = NameLabel.height * 4;
            NameLabel.text = [NSString stringWithFormat:@"%@: %@间",model.userName,model.count];
            NameLabel.font = NumberLabel.font;
            NameLabel.textColor = WYCRGBColor(141,153,178);
            [rankingView addSubview:NameLabel];
            
            
            
        }
        
        UILabel * OverconsumptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(verticalline.frame) + 60 * px, ReservationrankingLabel.y, ReservationrankingLabel.width, ReservationrankingLabel.height)];
        OverconsumptionLabel.text = [NSString stringWithFormat:@"%@",self.overConsumption];
        OverconsumptionLabel.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
        OverconsumptionLabel.textColor = [UIColor whiteColor];
        [CellView addSubview:OverconsumptionLabel];
        
        
        
        UILabel * OverconsumptionCount = [[UILabel alloc] initWithFrame:CGRectMake(OverconsumptionLabel.x, CGRectGetMaxY(OverconsumptionLabel.frame) + 10 * px, 100 * px, 85   * px)];
        OverconsumptionCount.text = [NSString stringWithFormat:@"%@",self.consumptionlist];
        OverconsumptionCount.font = [UIFont systemFontOfSize:SYRealValue(60 / 2)];
        OverconsumptionCount.textColor = FontColor;
        [CellView addSubview:OverconsumptionCount];
        
        
        
        UIView *rankingRightView = [[UIView alloc]init];
        rankingRightView.frame = CGRectMake(OverconsumptionCount.x, CGRectGetMaxY(OverconsumptionCount.frame) + 30 * px, rankingView.width, rankingView.height / 3 * 2);
        rankingRightView.backgroundColor = rankingView.backgroundColor;
        [CellView addSubview:rankingRightView];
        
        
        
        for (NSInteger j = 0; j < self.roomTypeListArray.count; j ++) {
            MSHomeRoomTypeModel * typeModel = self.roomTypeListArray[j];
            UILabel * CountLabel = [[UILabel alloc] init];
            CountLabel.x = 0;
            CountLabel.height = 30 * px;
            CountLabel.y = (CountLabel.height + 15) * j;
            CountLabel.width = CountLabel.height * 8;
            CountLabel.text = [NSString stringWithFormat:@"%@: %@间",typeModel.roomTypeName,typeModel.roomList];
            CountLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            CountLabel.textColor = WYCRGBColor(141,153,178);
            [rankingRightView addSubview:CountLabel];
            
        }
        
        
        /** <#name#>*/
        UIButton * rankingRightViewButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, rankingRightView.width, rankingRightView.height)];
        [rankingRightViewButton  addTarget:self action:@selector(CellmRightMoreButtonClick) forControlEvents:UIControlEventTouchUpInside];
        rankingRightViewButton.backgroundColor = [UIColor clearColor];
        [rankingRightView  addSubview:rankingRightViewButton];
        //详情按钮
        UIButton * CellmMoreButton = [[UIButton alloc] initWithFrame:CGRectMake(CellView.width * 0.5  -  210 * px, CGRectGetMaxY(rankingView.frame) + 20 * px, 150 * px, 60 * px)];
        //设置边框的颜色
        [CellmMoreButton setTitle:[NSString stringWithFormat:@"%@",self.roommore] forState:UIControlStateNormal];
        [CellmMoreButton.layer setBorderColor:WYCRGBColor(80, 112, 148).CGColor];
        CellmMoreButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
        [CellmMoreButton addTarget:self action:@selector(CellMoreButtonClick) forControlEvents:UIControlEventTouchUpInside];
        //设置边框的粗细
        [CellmMoreButton.layer setBorderWidth:1.0];
        [CellmMoreButton setTitleColor:WYCRGBColor(78, 109, 144) forState:UIControlStateNormal];
        CellmMoreButton.layer.cornerRadius = CellmMoreButton.height * 0.5;
        [CellView addSubview:CellmMoreButton];
        
        
        
        //详情按钮
        UIButton * CellmRightMoreButton = [[UIButton alloc] initWithFrame:CGRectMake(CellView.width -  210 * px, CellmMoreButton.y, CellmMoreButton.width, CellmMoreButton.height)];
        //设置边框的颜色
        [CellmRightMoreButton setTitle:[NSString stringWithFormat:@"%@",self.roommore] forState:UIControlStateNormal];
        [CellmRightMoreButton.layer setBorderColor:WYCRGBColor(78, 109, 144).CGColor];
        CellmRightMoreButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
        [CellmRightMoreButton addTarget:self action:@selector(CellmRightMoreButtonClick) forControlEvents:UIControlEventTouchUpInside];
        //设置边框的粗细
        [CellmRightMoreButton.layer setBorderWidth:1.0];
        [CellmRightMoreButton setTitleColor:WYCRGBColor(59, 84, 112) forState:UIControlStateNormal];
        CellmRightMoreButton.layer.cornerRadius = CellmMoreButton.height * 0.5;
        [CellView addSubview:CellmRightMoreButton];
        
        
        
    }else if (indexPath.section == 2){
        
        cell.contentView.backgroundColor = WYCRGBColor(20, 33, 48);
        if (indexPath.row == 0) {
            UIView *CellView = [[UIView alloc]init];
            CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 400 * px);
            CellView.backgroundColor = WYCRGBColor(45, 54, 70);
//            CellView.cornerRadius = 20 * px;
            // 左上和右上为圆角
            
            UIBezierPath *cornerRadiusPath = [UIBezierPath bezierPathWithRoundedRect:CellView.bounds byRoundingCorners:UIRectCornerTopRight | UIRectCornerTopLeft cornerRadii:CGSizeMake(20 * px, 20 * px)];
            CAShapeLayer *cornerRadiusLayer = [ [CAShapeLayer alloc ] init];
            cornerRadiusLayer.frame = CellView.bounds;
            cornerRadiusLayer.path = cornerRadiusPath.CGPath;
            CellView.layer.mask = cornerRadiusLayer;
            [cell.contentView addSubview:CellView];
            
            
            UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 1, CellView.width, 1)];
            line.backgroundColor = WYCRGBColor(55, 63, 84);
            [CellView addSubview:line];
            
            UIImageView * photoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 130 * px, 80 * px, 80 * px)];
            photoIMG.image = [UIImage imageNamed:@"syze_icon"];
            [CellView addSubview:photoIMG];
            
            
            
            UILabel * shouyiTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(photoIMG.frame) + 60 * px, 30 * px, 260 * px, 60 * px)];
            shouyiTitleLabel.text = [NSString stringWithFormat:@"%@",self.shouyiTitleLabel];
            shouyiTitleLabel.font = [UIFont boldSystemFontOfSize:SYRealValue(28 / 2)];
            shouyiTitleLabel.textColor = [UIColor whiteColor];
            [CellView addSubview:shouyiTitleLabel];
//            self.shouyiTitleLabel = shouyiTitleLabel;
            
            
            
            UILabel * shouyiLabel = [[UILabel alloc] initWithFrame:CGRectMake(shouyiTitleLabel.x, CGRectGetMaxY(shouyiTitleLabel.frame) + 30 * px, ScreenWidth / 3 * 2, shouyiTitleLabel.height)];
            shouyiLabel.textAlignment = NSTextAlignmentLeft;
            shouyiLabel.text = [NSString stringWithFormat:@"￥%@", self.shouyiLabel];
            shouyiLabel.font = [UIFont systemFontOfSize:SYRealValue(64 / 2)];
            shouyiLabel.textColor = FontColor;
            [CellView addSubview:shouyiLabel];
            
            
            UILabel * CashLabel = [[UILabel alloc] initWithFrame:CGRectMake(shouyiTitleLabel.x, CGRectGetMaxY(shouyiLabel.frame) + 30 * px, CellView.width * 0.3, 50 * px)];
            CashLabel.text = [NSString stringWithFormat:@"%@", self.CashLabel];
            CashLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
            CashLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:CashLabel];
            
            
            UILabel * WxchatLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(CashLabel.frame) + 30 * px, CashLabel.y, CashLabel.width, CashLabel.height)];
            WxchatLabel.text = [NSString stringWithFormat:@"%@", self.WxchatLabel];
            WxchatLabel.font = CashLabel.font;
            WxchatLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:WxchatLabel];
            
            UILabel * PayCardLabel = [[UILabel alloc] initWithFrame:CGRectMake(CashLabel.x, CGRectGetMaxY(CashLabel.frame) + 30 * px, CashLabel.width, CashLabel.height)];
            PayCardLabel.text = [NSString stringWithFormat:@"%@", self.PayCardLabel];
            PayCardLabel.font = CashLabel.font;
            PayCardLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:PayCardLabel];
            
            UILabel * AlipayLabel = [[UILabel alloc] initWithFrame:CGRectMake(WxchatLabel.x, PayCardLabel.y, CashLabel.width, CashLabel.height)];
            AlipayLabel.text = [NSString stringWithFormat:@"%@", self.AlipayLabel];
            AlipayLabel.font = CashLabel.font;
            AlipayLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:AlipayLabel];
        }else if (indexPath.row == 1){
            
            UIView *CellView = [[UIView alloc]init];
            CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 300 * px);
            CellView.backgroundColor = WYCRGBColor(45, 54, 70);
            [cell.contentView addSubview:CellView];
            
            
            UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 1, CellView.width, 1)];
            line.backgroundColor = WYCRGBColor(53,63,79);
            [CellView addSubview:line];
            
            UIImageView * VipIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 100 * px, 80 * px, 80 * px)];
            VipIMG.image = [UIImage imageNamed:@"hyk_icon"];
            [CellView addSubview:VipIMG];
            
            
            
            UILabel * VIPTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(VipIMG.frame) + 60 * px, 30 * px, 260 * px, 60 * px)];
            VIPTitleLabel.text = [NSString stringWithFormat:@"%@", self.VIPTitleLabel];
            VIPTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            VIPTitleLabel.textColor = [UIColor whiteColor];
            [CellView addSubview:VIPTitleLabel];
            
            
            UILabel * RechargeLabel = [[UILabel alloc] initWithFrame:CGRectMake(VIPTitleLabel.x, CGRectGetMaxY(VIPTitleLabel.frame) + 40 * px, 600 * px, 50 * px)];
            RechargeLabel.text = [NSString stringWithFormat:@"%@", self.RechargeLabel];
            RechargeLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
            RechargeLabel.textColor = WYCRGBColor(141,153,178);;
            [CellView addSubview:RechargeLabel];
            
            UILabel * ConsumptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(VIPTitleLabel.x, CGRectGetMaxY(RechargeLabel.frame) + 30 * px, RechargeLabel.width, RechargeLabel.height)];
            ConsumptionLabel.text = [NSString stringWithFormat:@"%@", self.ConsumptionLabel];
            ConsumptionLabel.font = RechargeLabel.font;
            ConsumptionLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:ConsumptionLabel];
        }else if (indexPath.row == 2){
            
            UIView *CellView = [[UIView alloc]init];
            CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 300 * px);
            CellView.backgroundColor = WYCRGBColor(45, 54, 70);
            [cell.contentView addSubview:CellView];
            
            
            UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 1, CellView.width, 1)];
            line.backgroundColor = WYCRGBColor(55, 63, 84);
            [CellView addSubview:line];
            
            UIImageView * VipIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 100 * px, 80 * px, 80 * px)];
            VipIMG.image = [UIImage imageNamed:@"gzsj_icon"];
            [CellView addSubview:VipIMG];
            
            
            
            UILabel * guazhangTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(VipIMG.frame) + 60 * px, 30 * px, 260 * px, 60 * px)];
            guazhangTitleLabel.text = [NSString stringWithFormat:@"%@", self.guazhangTitleLabel];
            guazhangTitleLabel.font = [UIFont boldSystemFontOfSize:SYRealValue(28 / 2)];
            guazhangTitleLabel.textColor = [UIColor whiteColor];
            [CellView addSubview:guazhangTitleLabel];
            
            
            UILabel * RepaymentLabel = [[UILabel alloc] initWithFrame:CGRectMake(guazhangTitleLabel.x, CGRectGetMaxY(guazhangTitleLabel.frame) + 40 * px, 600 * px, 50 * px)];
            RepaymentLabel.text = [NSString stringWithFormat:@"%@", self.RepaymentLabel];
            RepaymentLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
            RepaymentLabel.textColor = WYCRGBColor(141,153,178);;
            [CellView addSubview:RepaymentLabel];
        
            
            
            UILabel * RepaymentamountLabel = [[UILabel alloc] initWithFrame:CGRectMake(guazhangTitleLabel.x, CGRectGetMaxY(RepaymentLabel.frame) + 30 * px, RepaymentLabel.width, RepaymentLabel.height)];
            RepaymentamountLabel.text = [NSString stringWithFormat:@"%@", self.RepaymentamountLabel];
            RepaymentamountLabel.font = RepaymentLabel.font;
            RepaymentamountLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:RepaymentamountLabel];
        }else if (indexPath.row == 3) {
            UIView *CellView = [[UIView alloc]init];
            CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 450 * px);
            CellView.backgroundColor = WYCRGBColor(45, 54, 70);
            [cell.contentView addSubview:CellView];
            
            
            UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 1, CellView.width, 1)];
            line.backgroundColor = WYCRGBColor(55, 63, 84);
            [CellView addSubview:line];
            
            UIImageView * photoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 100 * px, 80 * px, 80 * px)];
            photoIMG.image = [UIImage imageNamed:@"qtsy_icon"];
            [CellView addSubview:photoIMG];
            
            
            
            UILabel * qitaTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(photoIMG.frame) + 60 * px, 30 * px, 360 * px, 60 * px)];
            qitaTitleLabel.text = [NSString stringWithFormat:@"%@", self.qitaTitleLabel];
            qitaTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            qitaTitleLabel.textColor = [UIColor whiteColor];
            [CellView addSubview:qitaTitleLabel];
            
            
            UILabel * qitaLabel = [[UILabel alloc] initWithFrame:CGRectMake(qitaTitleLabel.x, CGRectGetMaxY(qitaTitleLabel.frame) + 30 * px, ScreenWidth / 3 * 2, qitaTitleLabel.height)];
            qitaLabel.textAlignment = NSTextAlignmentLeft;
            qitaLabel.text = [NSString stringWithFormat:@"￥%@", self.qitaLabel];
            qitaLabel.font = [UIFont systemFontOfSize:SYRealValue(64 / 2)];
            qitaLabel.textColor = FontColor;
            [CellView addSubview:qitaLabel];
            
            
            UILabel * OCashLabel = [[UILabel alloc] initWithFrame:CGRectMake(qitaLabel.x, CGRectGetMaxY(qitaLabel.frame) + 30 * px, CellView.width * 0.3, 50 * px)];
            OCashLabel.text = [NSString stringWithFormat:@"%@", self.OCashLabel];
            OCashLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
            OCashLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:OCashLabel];
            
            
            UILabel * OWxchatLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(OCashLabel.frame) + 30 * px, OCashLabel.y, OCashLabel.width, OCashLabel.height)];
            OWxchatLabel.text = [NSString stringWithFormat:@"%@", self.OWxchatLabel];
            OWxchatLabel.font = OCashLabel.font;
            OWxchatLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:OWxchatLabel];
            
            
            
            UILabel * otherWchatLabel = [[UILabel alloc] initWithFrame:CGRectMake(OCashLabel.x, CGRectGetMaxY(OCashLabel.frame) + 30 * px, OCashLabel.width, OCashLabel.height)];
            otherWchatLabel.text = [NSString stringWithFormat:@"%@", self.incomebankCardMoney];
            otherWchatLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
            otherWchatLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:otherWchatLabel];
            
            
            UILabel * otherCardLabel = [[UILabel alloc] initWithFrame:CGRectMake(OWxchatLabel.x, otherWchatLabel.y, OWxchatLabel.width, OWxchatLabel.height)];
            otherCardLabel.text = [NSString stringWithFormat:@"%@", self.incomeotherAilMoney];
            otherCardLabel.font = OCashLabel.font;
            otherCardLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:otherCardLabel];
            
            
            UILabel * otherlastLabel = [[UILabel alloc] initWithFrame:CGRectMake(otherWchatLabel.x, CGRectGetMaxY(otherWchatLabel.frame) + 30 * px, otherWchatLabel.width, otherWchatLabel.height)];
            otherlastLabel.text = [NSString stringWithFormat:@"%@", self.incomeotherMemberShipMoney];
            otherlastLabel.font = OCashLabel.font;
            otherlastLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:otherlastLabel];
            
            
        }else{
            UIView *CellView = [[UIView alloc]init];
            CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 300 * px);
            CellView.backgroundColor = BackViewColor;
            
            
            UIBezierPath *cornerRadiusPath = [UIBezierPath bezierPathWithRoundedRect:CellView.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(20 * px, 20 * px)];
            CAShapeLayer *cornerRadiusLayer = [ [CAShapeLayer alloc ] init];
            cornerRadiusLayer.frame = CellView.bounds;
            cornerRadiusLayer.path = cornerRadiusPath.CGPath;
            CellView.layer.mask = cornerRadiusLayer;
            [cell.contentView addSubview:CellView];
            
            
            UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 1, CellView.width, 1)];
            line.backgroundColor = WYCRGBColor(55, 63, 84);
            [CellView addSubview:line];
            
            UIImageView * photoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 100 * px, 80 * px, 80 * px)];
            photoIMG.image = [UIImage imageNamed:@"zdfy_icon"];
            [CellView addSubview:photoIMG];
            
            
            
            UILabel * zhaodaiTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(photoIMG.frame) + 60 * px, 30 * px, 260 * px, 60 * px)];
            zhaodaiTitleLabel.text = [NSString stringWithFormat:@"%@", self.zhaodaiTitleLabel];
            zhaodaiTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            zhaodaiTitleLabel.textColor = [UIColor whiteColor];
            [CellView addSubview:zhaodaiTitleLabel];
            
            
            
            UILabel * ZTotalLabel = [[UILabel alloc] initWithFrame:CGRectMake(zhaodaiTitleLabel.x, CGRectGetMaxY(zhaodaiTitleLabel.frame) + 50 * px, ScreenWidth / 3 * 2, 60 * px)];
            ZTotalLabel.textAlignment = NSTextAlignmentLeft;
            ZTotalLabel.text = [NSString stringWithFormat:@"￥%@", self.ZTotalLabel];
            ZTotalLabel.font = [UIFont boldSystemFontOfSize:SYRealValue(64 / 2)];
            ZTotalLabel.textColor = WYCRGBColor(73, 147, 235);
            [CellView addSubview:ZTotalLabel];
            
        }
        
    }else if (indexPath.section == 3){
            
            cell.contentView.backgroundColor = WYCRGBColor(20, 33, 48);
        
            UIView *CellView = [[UIView alloc]init];
            CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 700 * px);
            CellView.cornerRadius = 20 * px;
            CellView.backgroundColor = BackViewColor;
            [cell.contentView addSubview:CellView];
        
            //        [CellView addSubview:_progressView];
            UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height * 0.4, CellView.width, 1)];
            line.backgroundColor = WYCRGBColor(55, 63, 84);
            [CellView addSubview:line];
        
        
            UIView * verticalline = [[UIView alloc] initWithFrame:CGRectMake(CellView.width * 0.5, 0, line.height,line.y)];
            verticalline.backgroundColor = WYCRGBColor(55, 63, 84);
            [CellView addSubview:verticalline];
        
        
            UILabel * CellTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellView.width / 6, 30 * px, CellView.width * 0.25, 60 * px)];
            CellTitleLabel.text = [NSString stringWithFormat:@"%@",self.sumMoneyTitle];
            CellTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            CellTitleLabel.textColor = [UIColor whiteColor];
            [CellView addSubview:CellTitleLabel];
        
        
            UILabel * TodayLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(CellTitleLabel.frame) + 50 * px, CellView.width * 0.5, CellTitleLabel.height)];
            TodayLabel.text = [NSString stringWithFormat:@"￥%@",self.sumMoney];
            TodayLabel.font = [UIFont systemFontOfSize:SYRealValue(48 / 2)];
            TodayLabel.textColor = FontColor;
            TodayLabel.textAlignment = NSTextAlignmentCenter;
            [CellView addSubview:TodayLabel];
        
        
        
            UILabel * SweepCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellView.width / 7 + CellView.width / 2, 30 * px, CellTitleLabel.width, CellTitleLabel.height)];
            SweepCountLabel.text = [NSString stringWithFormat:@"%@",self.sweepCodeSize];
            SweepCountLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            SweepCountLabel.textColor = [UIColor whiteColor];
            SweepCountLabel.textAlignment = NSTextAlignmentCenter;
            [CellView addSubview:SweepCountLabel];
        
        
            UILabel * TodaySweepLabel = [[UILabel alloc] initWithFrame:CGRectMake(SweepCountLabel.x, TodayLabel.y, SweepCountLabel.width, TodayLabel.height)];
            TodaySweepLabel.text = [NSString stringWithFormat:@"%@",self.rewardNumber];
            TodaySweepLabel.font = [UIFont systemFontOfSize:SYRealValue(48 / 2)];
            TodaySweepLabel.textColor = [UIColor whiteColor];
            TodaySweepLabel.textAlignment = NSTextAlignmentCenter;
            [CellView addSubview:TodaySweepLabel];
        
        
            UILabel * WinningCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, CGRectGetMaxY(line.frame) + 30 * px, CellView.width * 0.5 ,TodayLabel.height)];
            WinningCountLabel.text = [NSString stringWithFormat:@"%@",self.winningPeople];
            WinningCountLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            WinningCountLabel.textColor = TodaySweepLabel.textColor;
            WinningCountLabel.textAlignment = NSTextAlignmentLeft;
            [CellView addSubview:WinningCountLabel];
        
//            NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:WinningCountLabel.text];
//
//            [str addAttribute:NSForegroundColorAttributeName value:FontColor range:NSMakeRange(7,2)];
//            WinningCountLabel.attributedText = str;
        
        
            UIView *PrizeWinningView = [[UIView alloc]init];
            PrizeWinningView.frame = CGRectMake(WinningCountLabel.x, CGRectGetMaxY(WinningCountLabel.frame) + 20 * px, CellView.width - 120 * px, 250 * px);
//            PrizeWinningView.cornerRadius = 20 * px;
            PrizeWinningView.backgroundColor = [UIColor clearColor];
            [CellView addSubview:PrizeWinningView];
        
//            CGFloat PrizeWinninglabelX = 0;
//            CGFloat PrizeWinninglabelH = 50 * px;
//            CGFloat PrizeWinninglabelW = PrizeWinningView.width * 0.7;
//
//            for (int i = 0; i < 3; i++) {
                /** 获奖信息*/
                UILabel * PrizeWinninglabel =  [[UILabel alloc] initWithFrame:CGRectMake(0, 0, PrizeWinningView.width, 60 * px)];
                PrizeWinninglabel.textColor = WYCRGBColor(141,153,178);;
                PrizeWinninglabel.text = [NSString stringWithFormat:@"%@",self.more];
                PrizeWinninglabel.textAlignment = NSTextAlignmentLeft;
                PrizeWinninglabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
                [PrizeWinningView addSubview:PrizeWinninglabel];
//            }
        
        
        
//            //详情按钮
//            UIButton * CellmMoreButton = [[UIButton alloc] initWithFrame:CGRectMake(CellView.width  -  210 * px, CellView.height - 110 * px, 150 * px, 60 * px)];
//            //设置边框的颜色
//            [CellmMoreButton setTitle:[NSString stringWithFormat:@"%@",self.more] forState:UIControlStateNormal];
//            [CellmMoreButton.layer setBorderColor:WYCRGBColor(80, 112, 148).CGColor];
//            CellmMoreButton.titleLabel.font = WinningCountLabel.font;
//            //设置边框的粗细
//            [CellmMoreButton.layer setBorderWidth:1.0];
//            [CellmMoreButton setTitleColor:WYCRGBColor(78, 109, 144) forState:UIControlStateNormal];
//            CellmMoreButton.layer.cornerRadius = CellmMoreButton.height * 0.5;
//            [CellView addSubview:CellmMoreButton];
    }
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section == 0) {
        MSCheckDetailedController * CheckVC = [[MSCheckDetailedController alloc] init];
        [self.navigationController pushViewController:CheckVC animated:NO];
    }else if (indexPath.section == 1){
//        MSRoomDetailedController * RoomVC = [[MSRoomDetailedController alloc] init];
//        [self.navigationController pushViewController:RoomVC animated:NO];
    }
    
}

//房间列表
- (void)amitionButtonClick{
    WYCLogFunc;
    MSCaiwuController * BindingRelationsVC = [[MSCaiwuController alloc] init];
    BindingRelationsVC.TagStr = @"1";
    [self.navigationController pushViewController:BindingRelationsVC animated:NO];
}
//房间排名点击
- (void)CellMoreButtonClick{
    MSBookersOpeningRankController * BookerVC = [[MSBookersOpeningRankController alloc] init];
    [self.navigationController pushViewController:BookerVC animated:NO];
    
}

//房间管理
- (void)CellmRightMoreButtonClick{
    
    MSChaoConsumptionController * RoomVC = [[MSChaoConsumptionController alloc] init];
    RoomVC.tagStr = @"1";
    [self.navigationController pushViewController:RoomVC animated:NO];
}

@end
